<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/public/header.jsp"%>
<%
	String customer_id = request.getParameter("customer_id") == null ? "" : request.getParameter("customer_id");
%>
<html>
	<head>
		<title>账款明细</title>
	</head>
	<script type="text/javascript">
		$(function(){
			$('#cc').combobox({
				valueField: 'label',
				textField: 'value',
				data: [{
					value: '全部',
					label: '0'
				},{
					value: '去掉已结账',
					label: '1'
				}],
				onSelect:function(record){
					$('#table').datagrid('load',{
						search:record.label,
						customer_id:'<%=customer_id%>'
					});
				}
			});
			$('#table').datagrid({
				title:'账款明细',
				rownumber:true,
				url:'<%=contextPath %>/springMVC/crm/listPageCustomerFinanceInDetail?customer_id=<%=customer_id%>', 
				loadMsg:'正在加载数据，请稍后......',
				fitColumns:true,
				nowrap:false,
				columns:[[
					{title:'id',field:'id',hidden:true},
					{title:'项目编号',field:'xm_code',width:200,align:'center'},
					{title:'项目名称',field:'xm_name',width:200,align:'center'},
					{title:'应收金额',field:'finance_in',width:200,align:'center'},
					{title:'往来流水',field:'detial',width:50,align:'center',formatter:function(value,rowData,rowIndex){
						return "<input type='button'   style='border:0px #ff0000 solid;width:16px;height:16px;cursor:pointer;' class='icon-details'    onclick=\"javascript:showDetail('"+ rowData.id +"');\">";
					}}
				]],
				pageSize:10,
				pageList : [10,50,100],  
				pagination:true,
				onLoadSuccess:function(rtJson){
					if(rtJson.rtState== '1')
					{
						warningInfo(rtJson.rtMsrg);
					}
				}
			});
			//----end
		});
		function showDetail(detail_id){
			openDialogResize("<%=contextPath %>/springViews/crm/customerFinanceInLog.jsp?detail_id="+detail_id,1000, 800);
		}

	</script>
	<body>
		    	    <div id="table"  data-options="fit:true,toolbar:'#queryParamDiv'"></div>  
		    	    <div id="queryParamDiv" style="padding:3px;height:auto">
						<div align="right">
							过滤条件: 
							<input id="cc">  
						</div>
					</div>
	</body>
</html>
